package com.pluszg.nutrition.database.config;

import com.pluszg.nutrition.database.aop.PageBeanAspect;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EntityScan(basePackages = "com.pluszg.nutrition.model")
@EnableTransactionManagement
@MapperScan("com.pluszg.nutrition.database.mapper")
public class DBAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public PageBeanAspect pageBeanAspect() {
        return new PageBeanAspect();
    }
}
